export default defineEventHandler((event) => {
  const config = useRuntimeConfig()
  const baseURL = config.public.siteUrl || 'http://localhost:3000'

  const robotsTxt = `User-agent: *
Allow: /

# Sitemaps
Sitemap: ${baseURL}/sitemap.xml

# Disallow admin areas (if any)
Disallow: /admin/
Disallow: /api/`

  event.node.res.setHeader('Content-Type', 'text/plain')
  return robotsTxt
})

